<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$Title$</title>
    <script type="text/javascript" src="/zhijiaoyun/js/jquery-3.2.1.min.js"></script>
</head>
<body>

<form id="login" method="post" action="/zhijiaoyun/api/user/login1">
    token: <input type="text" name="token" />
    <input id="submit" type="button" value="submit" />
    <label id="return" value="" />
</form>

</body>

<script>
    $(function () {
        $('#submit').click(function () {
            $.ajax({
                url: '/zhijiaoyun/api/user/checkToken',
                type: 'post',
                data: {
                    token: $('#login input[name="token"]').val()
                },
                success: function (response) {
                    if (response.code == 200) {
                        document.cookie = "token=" + response.token;
                        $('#return').val(response.token);
                    } else {
                        $('#return').val(response.message);
                    }
                }
            })
        })
    })

</script>
</html>